home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / Text Capture FKEY / FixPC.h < prev    next >
Text File  |  1995-09-10  |  828b  |  23 lines

  1. // This is taken from TN 228.  TN 212 recommends using this at the main
  2. // entry point of all INITs and external routines.
  3.  
  4.  
  5. pascal void FixPC( void )
  6.        = {0x41FA, 0x000A,  /*   LEA        *+$000C,A0                     */
  7.           0x2008,          /*   MOVE.L     A0,D0                          */
  8.           0xA055,          /*   _StripAddress                             */
  9.           0x2040,          /*   MOVEA.L    D0,A0                          */
  10.           0x4ED0};         /*   JMP        (A0) ;jmps to next instruction */
  11.  
  12. // This version is equivalent, but is for inclusion in asm {}.
  13. // The reason for using A1 rather than A0 is so as not to confuse the
  14. // CODE editor in ResEdit.
  15.  
  16. #define        FIXPC    \
  17.                 LEA            @fixed_pc, A1\
  18.                 move.L        A1, D0\
  19.                 StripAddress\
  20.                 moveA.L        D0, A1\
  21.                 jmp            (A1)\
  22.             @fixed_pc
  23.